//
//  DDDNativeExpressAdManager.h
//  DDDDemo
//
//  Created by mu on 2020/3/4.
//  Copyright © 2020 summer. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "DDDNativeExpressAdView.h"


NS_ASSUME_NONNULL_BEGIN

@class DDDNativeExpressAdManager;

@protocol DDDNativeExpressAdViewDelegate <NSObject>

@optional

/// 获取到视图的回调
/// @param nativeExpressAd nativeExpressAd
/// @param views 所有的视图数组
- (void)nativeExpressDrawAdSuccessToLoad:(DDDNativeExpressAdManager *)nativeExpressAd views:(NSArray<__kindof DDDNativeExpressAdView *> *)views;

/// 视图加载失败时的回调
/// @param errorCode errorCode
- (void)nativeExpressDrawAdFailToLoadError:(NSInteger)errorCode;

/// 视图呈现成功时的回调
- (void)nativeExpressDrawAdViewRenderSuccess;

/// 视图呈现失败时的回调
/// @param errorCode errorCode
- (void)nativeExpressDrawAdViewRenderFailError:(NSInteger)errorCode;

/// 视图即将显示内容时的回调
- (void)nativeExpressDrawAdViewWillShow;

/// 视图被点击时的回调
- (void)nativeExpressDrawAdViewDidClick;

/// 视图播放完成或出现错误时的回调
/// @param errorCode 错误码为0 为播放完成
- (void)nativeExpressDrawAdViewPlayerDidPlayFinishError:(NSInteger)errorCode;

/// 视图即将推出新视图时的回到
- (void)nativeExpressDrawAdViewWillPresentScreen;



@end

@interface DDDNativeExpressAdManager : NSObject


@property (nonatomic, weak, nullable) id<DDDNativeExpressAdViewDelegate> delegate;


/// 初始化
/// @param size 视图size
- (instancetype)initWithAdSize:(CGSize)size;

/// 初始化
/// @param size 视图size
/// @param userID 用户唯一标志（一般为接入让用户id）
- (instancetype)initWithAdSize:(CGSize)size andUserID:(NSString *)userID __attribute__((deprecated("请使用initWithAdSize方法初始化 userId统一在初始化sdk时传入  1.0.0.8以后版本将不再提供该方法")));

/// 获取视图
/// @param count 一次获取数量（最多3个）
- (void)loadAd:(NSInteger)count;

@end

NS_ASSUME_NONNULL_END
